dist_in = dist_BC_3comp_2d;

for i = 1:size(dist_in,1),
     [m idx] = min(dist_in(i,:) );
     fprintf('%2d -> %2d (%f)\n',i,idx,m);
end